/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaBar.java
 *
 * Created on 17/06/2010, 22:04:36
 */

package br.com.pi.SmartFast.view;

import br.com.pi.SmartFast.controler.ControleBar;

/**
 *
 * @author Alessandro
 */
public class TelaBar extends javax.swing.JFrame {

    ControleBar control;

    /** Creates new form TelaBar */
    public TelaBar() {
        initComponents();
        control= new ControleBar(lista_bebidas, lista_auxilio_mesa,
                tree_arvore, this, dial_consulta,lbl_imagem_bar);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dial_consulta = new javax.swing.JDialog();
        jPanel2 = new javax.swing.JPanel();
        lbl_imagem_bar = new javax.swing.JLabel();
        botao_sair_dial_bar = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        tree_arvore = new javax.swing.JTree();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        lista_bebidas = new javax.swing.JList();
        jLabel1 = new javax.swing.JLabel();
        botao_bebida_atendida = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        lista_auxilio_mesa = new javax.swing.JList();
        botao_garcom_atendido = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        jPanel2.setBackground(new java.awt.Color(204, 255, 204));

        lbl_imagem_bar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgBar.png"))); // NOI18N

        botao_sair_dial_bar.setBackground(new java.awt.Color(204, 255, 204));
        botao_sair_dial_bar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgSair.png"))); // NOI18N
        botao_sair_dial_bar.setBorder(null);
        botao_sair_dial_bar.setBorderPainted(false);
        botao_sair_dial_bar.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        botao_sair_dial_bar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_sair_dial_barActionPerformed(evt);
            }
        });

        tree_arvore.setBackground(new java.awt.Color(204, 255, 204));
        tree_arvore.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        tree_arvore.setForeground(new java.awt.Color(204, 255, 204));
        javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
        tree_arvore.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
        tree_arvore.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tree_arvoreMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tree_arvore);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(246, 246, 246)
                        .addComponent(botao_sair_dial_bar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(60, 60, 60))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbl_imagem_bar)
                        .addGap(83, 83, 83))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(87, 87, 87)
                        .addComponent(lbl_imagem_bar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(botao_sair_dial_bar))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 423, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(58, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dial_consultaLayout = new javax.swing.GroupLayout(dial_consulta.getContentPane());
        dial_consulta.getContentPane().setLayout(dial_consultaLayout);
        dial_consultaLayout.setHorizontalGroup(
            dial_consultaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        dial_consultaLayout.setVerticalGroup(
            dial_consultaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dial_consultaLayout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Tela Bar");
        setBounds(new java.awt.Rectangle(120, 120, 800, 600));
        setUndecorated(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowIconified(java.awt.event.WindowEvent evt) {
                formWindowIconified(evt);
            }
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(204, 255, 204));

        lista_bebidas.setBackground(new java.awt.Color(204, 255, 204));
        lista_bebidas.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        lista_bebidas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lista_bebidasMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(lista_bebidas);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel1.setText("Bebidas");

        botao_bebida_atendida.setText("Bebida entregue");
        botao_bebida_atendida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_bebida_atendidaActionPerformed(evt);
            }
        });

        lista_auxilio_mesa.setBackground(new java.awt.Color(204, 255, 204));
        lista_auxilio_mesa.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jScrollPane2.setViewportView(lista_auxilio_mesa);

        botao_garcom_atendido.setText("Solicitação Atendida");
        botao_garcom_atendido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_garcom_atendidoActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel2.setText("Auxílio Mesa");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(98, 98, 98)
                        .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                        .addGap(200, 200, 200)
                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
                        .addGap(12, 12, 12))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(92, 92, 92)
                        .addComponent(botao_bebida_atendida, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 246, Short.MAX_VALUE)
                        .addComponent(botao_garcom_atendido, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                        .addGap(142, 142, 142)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE)))
                .addGap(394, 394, 394))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(56, 56, 56)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane2)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botao_bebida_atendida)
                    .addComponent(botao_garcom_atendido))
                .addContainerGap(282, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowIconified(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowIconified
        // TODO add your handling code here:
    }//GEN-LAST:event_formWindowIconified

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

        control.TelaAoAbrir();
        
    }//GEN-LAST:event_formWindowOpened

    private void lista_bebidasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lista_bebidasMouseClicked

        control.ListaBebidasAoClicar(evt.getClickCount());
        
    }//GEN-LAST:event_lista_bebidasMouseClicked

    private void tree_arvoreMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tree_arvoreMouseClicked

        control.jTreeArvoreAoClicar();
    }//GEN-LAST:event_tree_arvoreMouseClicked

    private void botao_sair_dial_barActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_sair_dial_barActionPerformed

    control.botaoFecharDialogoProdutos();
    
    }//GEN-LAST:event_botao_sair_dial_barActionPerformed

    private void botao_bebida_atendidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_bebida_atendidaActionPerformed

        control.botaoBebidaEntregue();
        
    }//GEN-LAST:event_botao_bebida_atendidaActionPerformed

    private void botao_garcom_atendidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_garcom_atendidoActionPerformed

        control.botaoSolicitacaoEntregue();
        
    }//GEN-LAST:event_botao_garcom_atendidoActionPerformed

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new TelaBar().setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botao_bebida_atendida;
    private javax.swing.JButton botao_garcom_atendido;
    private javax.swing.JButton botao_sair_dial_bar;
    private javax.swing.JDialog dial_consulta;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JLabel lbl_imagem_bar;
    private javax.swing.JList lista_auxilio_mesa;
    private javax.swing.JList lista_bebidas;
    private javax.swing.JTree tree_arvore;
    // End of variables declaration//GEN-END:variables

}
